package de.tabuma.shopping.view;

import de.tabuma.lib.tabumaview;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.util.logging.*;

/**
 *
 * @author $Author: alefen $
 * @version $Revision: 1.2 $
 * @since $Date: 2009/07/21 19:37:33 $
 */
public class forwardToPayPal extends tabumaview {

    private static Logger log = Logger.getLogger(forwardToPayPal.class.getName());

    public forwardToPayPal(String servlet, Hashtable parameter, String url) {
        super(servlet, parameter);
    }


    public void processRequest(ServletContext context, HttpServletRequest request, HttpServletResponse response, PrintWriter out)  {
        try {

            out.println("<div class=\"contentContent\">");
            out.println("<script type=\"text/javascript\">");
            out.println("<!--");
            out.println("\tfunction delay()");
            out.println("\t{");
            out.println("\t\twindow.location=\""+request.getAttribute(de.tabuma.shopping.constants.URL)+"\";");
            out.println("\t}");
            out.println("\tsetTimeout('delay()', 5000);");
            out.println("//-->");
            out.println("</script>");
            out.println(de.tabuma.shopping.constants.getValueFromProperties("orders.forwardtopaypal.content"));
            out.println("<a href=\""+request.getAttribute(de.tabuma.shopping.constants.URL)+"\">"+de.tabuma.shopping.constants.getValueFromProperties("orders.forwardtopaypal.link")+"</a>.");
            out.println("</div>");

        }
        catch(Exception e) {
            log.warning(e.getMessage());
        }
    }

}
